package com.huluobo.high3videoproject.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.huluobo.high3videoproject.R;
import com.huluobo.high3videoproject.bean.LikeVideoBeanResult;
import com.huluobo.high3videoproject.bean.VideoBeanResult;
import com.huluobo.high3videoproject.utils.GlideUtils;

import java.util.List;

public class LikeVideoAdapter extends BaseQuickAdapter<LikeVideoBeanResult.LikeVideoBean, BaseViewHolder> {
    public LikeVideoAdapter(@Nullable List<LikeVideoBeanResult.LikeVideoBean> data) {
        super(R.layout.item_video_list, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, LikeVideoBeanResult.LikeVideoBean likeVideoBean) {
        //设置视频大图
        GlideUtils.load(getContext(), (ImageView) baseViewHolder.getView(R.id.item_img_iv),
                likeVideoBean.getVideomainimg(), R.mipmap.ic_launcher, R.mipmap.ic_launcher, 20);

        //设置视频头像
        GlideUtils.loadNormal(getContext(), baseViewHolder.getView(R.id.item_video_avatar_iv),
                likeVideoBean.getHeadpath());

        //设置作者名称
        baseViewHolder.setText(R.id.item_title_tv, likeVideoBean.getAuthname());
    }
}
